@tool
class_name RoomTileVisualizer
extends Node2D

@export var is_debug:bool = false:
	set (value):
		is_debug = value
		if is_debug:
			queue_redraw()
			show()
		else:
			hide()
#region Gizmos
func draw_room_tile_type():
	owner.update_tile_type_dict()
	for layer in owner.cur_room_tile_type_dict:
		for room_tile_type in owner.cur_room_tile_type_dict[layer]:
			for coords in owner.cur_room_tile_type_dict[layer][room_tile_type]:
				draw_rect(Rect2(owner.tilemap.to_global(coords * owner.tilemap.rendering_quadrant_size) ,Vector2(owner.tilemap.rendering_quadrant_size,owner.tilemap.rendering_quadrant_size)),owner.get_room_tile_color(room_tile_type),true)
#endregion
func _draw() -> void:
	if is_debug:
		draw_room_tile_type()
